<template>
  <van-popup
    v-model="showArea"
    position="bottom"
  >
    <van-area
      :columns-num="2"
      :area-list="areaList"
      @confirm="onConfirm"
      @cancel="showArea = false"
    />
  </van-popup>
</template>

<script>
import { areaList } from '@vant/area-data';
export default {
  name: 'AreaSelect',
  data () {
    return {
      showArea: false,
      areaList
    }
  },
  methods: {
    init () {
      this.showArea = true
    },
    onConfirm (values) {
      this.$emit('select', values)
      this.showArea = false;
    },
  }
}
</script>

<style lang="less" scoped>
</style>
